.radioCards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.radioCard {
  position: relative;
  padding: 0.75rem;
  border: 1px solid var(--theme-border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--theme-elevation-550);
  background-color: var(--theme-elevation-150);
  cursor: pointer;

  .styledRadioInput {
    &:after {
      opacity: 0;
    }
  }
}

.radioInput {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;

  &:checked + .radioCard,
  &:focus-visible + .radioCard {
    color: var(--theme-success-500);
    border-color: var(--theme-success-500);
    background-color: var(--theme-success-50);

    .styledRadioInput {
      background: var(--theme-success-100);
      &:after {
        opacity: 1;
      }
    }
  }

  &:checked:focus-visible + .radioCard {
    border-color: var(--theme-success-300);
  }

  &:not(:active):not(:checked):focus-visible + .radioCard,
  &:not(:active):not(:checked) + .radioCard:hover {
    color: var(--theme-elevation-550);
    background-color: var(--theme-elevation-150);
    border-color: var(--theme-elevation-500);

    .styledRadioInput {
      background: var(--theme-elevation-200);
      &:after {
        opacity: 1;
      }
    }
  }
}

.styledRadioInput {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
  cursor: pointer;

  &:after {
    content: '';
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
  }
}

:global([data-theme='light']) {
  .radioCard {
    background-color: var(--theme-elevation-50);
  }

  .radioInput {
    &:checked + .radioCard,
    &:focus-visible + .radioCard {
      border-color: var(--theme-success-550);
      color: var(--color-success-850);
      background-color: var(--theme-success-450);

      .styledRadioInput {
        background: var(--theme-success-600);
        &:after {
          opacity: 1;
        }
      }
    }

    &:checked:focus-visible + .radioCard {
      border-color: var(--theme-success-650);
    }

    &:not(:active):not(:checked):focus-visible + .radioCard,
    &:not(:active):not(:checked) + .radioCard:hover {
      color: var(--theme-elevation-550);
      background-color: var(--theme-elevation-100);
      border-color: var(--theme-elevation-300);

      .styledRadioInput {
        background: var(--theme-elevation-200);
        &:after {
          opacity: 1;
        }
      }
    }
  }
}
